let db=require('../db/index')

exports.loginAPI=(req,res)=>{
    // var sql='select * from user'
    // ${req.username}
    // ${req.body.username}/*  */
    // console.log('返回一下'+req.query.username)
    var sql=`select * from user where username ='${req.query.username}'`
    // console.log('req.username'+req.username)
    // var sql = `update user set user = '${req.body.user}'
    db.query(sql,[
        req.query.username,
        req.query.password,
        req.query.sex,
        req.query.email,
        
        
    ],(err,data)=>{
        if(err){
            return res.send('错误:'+err.message+'找不到该用户')
        }
        res.send(data)
    })
}